home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 January / macformat-020.iso / Reader's Corner / Reader's Contibutions / Rolf's Slide Show / Build your own slideshow next >
Encoding:
Text File  |  1994-10-03  |  12.2 KB  |  93 lines  |  [ttro/ttxt]

  1. Build your own Photo CD slide show using Hypercard
  2.  
  3. Introduction
  4.  
  5. “Rolf’s Slide Show” is the cut down version of a Hypercard stack I wrote to display some images that I had had transferred to Photo CD. It went through several iterations, first as I rapidly scaled down my aspirations once it become clear what the medium could actually support, and then slowly ramped up again once things started to work. Below are some notes on my experiences. Feel free to build on them and use this stack as the basis of your own interactive slide show if you like, but note that is very much a D.I.Y. stack and is not intended to be a finished ‘application’.
  6.  
  7. Since I started work on this stack I have come across several shareware applications that do a similar job, in particular Wolfgan Thaller’s excellent HyperSlider that was on a recent MacFormat CD, but Hypercard still offers advantages in that it is totally flexible and extendible whatever your requirements are (you may want to add buttons to play your own QuickTime movies, for example).
  8.  
  9. System requirements
  10.  
  11. The computer used to develop this stack was a Macintosh LC475 with 8Mb RAM, 13” RGB display, VRAM expansion to display thousands of colours, and Apple CD300 CD-ROM drive. Software used includes QuickTime 1.6.2, Apple CD-ROM and Photo Access extensions, Hypercard 2.2, including the ‘picture’ command and AddColor XCMD, and Adobe Photoshop (to crop, rotate and touch up images). No effort was made to make it work on anything other than a 13” screen, because that’s all I’ve got, but it shouldn’t be too difficult to make it behave acceptably on other sizes. The stack has been tested successfully with 4Mb of memory, but some features work best if you increase the memory allocated to the Hypercard application itself as much as possible (using Get Info in the Finder menu). This stack may work with Hypercard 2.1, but that is untested. You don’t need Photoshop – Kodak Access or NIH Image or something similar would be just as good.
  12.  
  13. Photo CD
  14.  
  15. Kodak Photo CD is an excellent way of getting high quality colour scans of your photos on to a computer. Images are scanned from 35mm slides or negatives in 24 bit colour, at various resolutions from 192x128 to 3072x2048. Up to 100 (nominally, in practice it is often more, up to 120 even) images are stored on one CD. Take your negatives to your nearest Boots, then come back a week later to take possession of your very own CD. Photo CD is very cheap for what it is, though it is probably a bit expensive for home use if you have a lot of images to transfer. 50 or 60p an image is no more than you’d pay for individual reprints, but that translates to £60 by the time you’ve filled a disk! I tend to be quite selective in the pictures I have transferred, which keeps the cost down a bit.
  16.  
  17. The most useful size for displaying Photo CD on the computer is 768x512. Each image is over 800k in size, and originally I experimented with running the slide show straight off CD. Unfortunately, this has several disadvantages:
  18.  
  19. a) Speed. Loading an image off CD instead of hard disk takes around 4-5 seconds, instead of about 1 second.
  20.  
  21. b) Rotation: None of the software I had access to from within Hypercard could rotate an image by 90 degrees, so pictures taken in portrait as opposed to landscape mode come out on their side! (Always loading images in landscape mode seems like a bug in the Apple Photo Access driver, as information on how to rotate images is encoded on the disk by the processing lab.)
  22.  
  23. c) Cropping: Originally my program cropped the image down from 768x512 to 640x480 centrally. However, you may want to be more selective in this, probably scaling the image first so you lose less of the image.
  24.  
  25. d) Touching up scratches and marks: A program like Photoshop is ideal for cleaning up your original images. Removing scratches, adjusting the colour balance, contrast and brightness, and sharpening up the image can make a huge improvement.
  26.  
  27. e) What happens when you have more than one Photo CD and need to keep switching disks?
  28.  
  29. Images on disk
  30.  
  31. At first I never dreamt of running off hard disk because of the size of each image. With JPEG encoding (using Photoshop’s Save As... PICT options), however, images can be compressed down to a manageable size:
  32.  
  33.     16-bit PICT     540K
  34.     8-bit                 250K
  35.     Max quality     160K
  36.     High quality    110K
  37.     Med quality      60K
  38.     Low quality     35K
  39.  
  40. (These are average sizes for 640x480 images.) Low quality is quite poor, with obvious blocking effects, but for most images it is difficult to tell the different between medium quality and any of the better settings, so I settled for medium. JPEG encoded images do take slightly longer to load than unencoded lower bit depth images, but this is well worth it when you consider the saving in space.
  41.  
  42. The processing I apply to each Photo CD image using Photoshop is generally as follows:
  43.  
  44. 1. Open the 768x512 version.
  45. 2. Rotate as necessary (usually by 90˚ of course, but possibly by other angles if the horizon wasn’t quite flat – why mess about when you have the technology to improve things?)
  46. 3. Brighten up the image by adjusting the contrast, brightness or colour balance as necessary (using Adjust Levels...).
  47. 4. Remove any scratches or spots with the clone tool.
  48. 5. Scale image to 720x480.
  49. 6. Crop to 640x480, either by setting paper size if central cropping is adequate, or using the crop tool if finer control is needed. Alternatively, if you don’t want to lose any of the image, scale it to 640x427 and then increase to 640x480 by adding a black border.
  50. 7. Save as PICT, with medium quality JPEG compression.
  51. 8. Use FileTyper to change the file creator to ‘ttxt’, so I can open the image quickly in SimpleText when I double click it, rather than waiting a year and a half while Photoshop starts up.
  52.  
  53. Obviously, once you load an image into Photoshop you can do whatever processing you like with it. One of the images on this disk, for example, is a panorama which was originally two photos. You’ve all done that, I’m sure, and ended up with prints that never quite line up or aren’t exposed the same. With Photoshop you can make rather better a job of it!
  54.  
  55. The stack
  56. There are two main types of card in this stack: Pictures and Sections. The bulk of the stack is Pictures. Each card contains the name of one PICT file, which is displayed using the Hypercard ‘picture’ command whenever that card is opened (unless you are in edit mode). Sections are used to group together related pictures and work rather like dividers: place a Section card at the beginning of a section, and all subsequent Pictures (up to it the next Section card) will belong to it.
  57.  
  58. Each Section card has a title, which is displayed in the ‘Sections’ menu and may be used for navigation through the stack. If you enter the name of a sound resource into the Sound field, you can arrange to have a piece of music played when that section is playing. Section cards do not automatically display a picture, but can contain anything you want. Usually I colour them using the AddColor colouring tools, place some brief text on them giving details about the pictures (date and location, for example), and add buttons to allow interactive operation as appropriate for that section, but it’s up to you. Section cards need not be displayed (if you check the Skip Section box), but can still be used for grouping, navigation, and playing music when they are suppressed like this.
  59.  
  60. Originally I only had one type of section card, but when my stack grew too big I added a higher level Main Section card to group together the Sections. If you look at their scripts, you’ll see that Sections and Main Sections are quite similar in operation. Unlike Pictures in Sections, however, where the grouping is implicit from the order of the cards in the stack, Sections have an explicit link to the Main Section they belong to. This greatly simplifies organising your stack at a high level, as you can move whole sections around without having to cut and paste dozens of cards individually to move them.
  61.  
  62. The only other cards which are special are the first two cards in the stack, which form the ‘splash screen’ displayed when Hypercard loads. Because they are not normally displayed during running of the show, their openCard handlers move straight onto the next card. These cards just happen to share the Sections background; I could just as easily have made them a separate background.
  63.  
  64. Operation of the stack is controlled by several global variables, the most important of which are autoRun and editMode:
  65.  
  66. When autoRun is true, the idle method of each card will automatically advance to the next card after the card has been displayed for long enough. The normal mode of operation with autoRun is to play through every card and cycle round, repeating indefinitely (until the mouse is clicked). The variables returnPoint and sectionNumber are used to restrict automatic running to a single section or main section.
  67. When editMode is true, all special processing and auto running is turned off, and all the various edit buttons and fields that control the show are made visible.
  68.  
  69. Displaying images in Hypercard
  70.  
  71. To display images in Hypercard you have two main options: use the built-in ‘picture’ command, or the AddColor XCMD. Both can take a couple of seconds to load an image from disk.
  72.  
  73. The picture command can be used to double buffer the image. Early versions of this stack started preparing the picture of the next card whenever one card was displayed, which speeds up the interactive response when pressing 3 to step to the next card. Buffering the image requires extra memory, and the buffering option is turned off by default if insufficient memory is available. (As each picture is displayed in a new window, one problem I kept encountering when developing using the picture command was ending up with several old picture windows lying around, invisible or obscured by other windows but still taking up memory.) You can choose to use a 16-bit or 8-bit buffer, depending on what type of display and how much memory you have.
  74.  
  75. The AddColor XCMD can be used like the picture command, to display images explicitly when required, or it can automatically colour in a card whenever it is opened if you use the Colouring Tools to store colour information for that card. This technique is used in this stack to display the coloured backgrounds for Main Section cards. When placing PICTs on a card in the Coloring Tools you can either place a PICT file directly or import the image into a PICT resource within the stack. To optimise the speed at which section cards are displayed, as this is particularly important during interactive operation, I use 8-bit PICTs (which are smaller and faster to load than larger bit depth images) imported into the stack for all my Sections.
  76.  
  77. Using the stack
  78.  
  79. The sample stack and pictures should work with no additional set up (though you may need to tell Hypercard how to find the Pictures folder when you first try it). To create your own slide show you need to copy the the stack, delete all cards apart from the first two (which contain scripts and a hidden index field) and one from each of the three backgrounds, then enter edit mode and start adding your own cards. With Picture cards you only need to select the image file name using the File selection dialog provided. On Section and Main Section cards you will either want to draw a background or title page using a paint package or create some sort of coloured background with the Coloring Tools. Once you have your coloured background, add buttons to move to particular cards or play whole sections as required, depending on how much control you want to give the user. Look at the scripts for the buttons provided in the sample stack to see how to play a section, and how to play a button click noise on pressing the button. To edit the sound effects and change the intro piece, edit the snd resources “Page”, “Click” and “Introduction” of the stack.
  80.  
  81.  
  82. If you find this stack useful, especially if you extend it in useful ways (there are numerous ways in which it could be improved), please let me know. Similarly if you decide to use any of the images as backdrops etc. A postcard or a disk with some interesting photos on dropping through my letterbox would always be welcome!
  83.  
  84. Rolf Howarth
  85. 18 The Green
  86. Snitterfield
  87. Stratford-upon-Avon
  88. CV37 0JG
  89. United Kingdom.
  90. Email: rolf@parallax.co.uk
  91.  
  92. 30 September 1994
  93.